import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns

# print(plt.style.available)
plt.style.use('fivethirtyeight')
train_data = pd.read_csv('./train.tsv', sep='\t')
train_data['sentence_length'] = list(map(lambda x: len(x), train_data['sentence']))

test_data = pd.read_csv('./dev.tsv', sep='\t')
test_data['sentence_length'] = list(map(lambda x: len(x), test_data['sentence']))

sns.countplot(train_data['sentence_length'])
plt.xticks([])
# plt.show()

sns.displot(train_data['sentence_length'])
plt.yticks([])
plt.savefig('14_text_analysis2.png')
plt.show()

sns.countplot(test_data['sentence_length'])
plt.xticks([])
# plt.show()

sns.displot(test_data['sentence_length'])
plt.yticks([])
plt.savefig('14_text_analysis2-2.png')
plt.show()
